import { SchemaManageAPI } from '@/components/SchemaComponent/SchemaManage/type';
import { getLevelZeroJson } from '@/utils';

/** 专家库管理检索字段 */
export const getNeedManageSearchColumns = ({ needStateList, supplyWayList }: any): Array<SchemaManageAPI.ISearchList> => {
  return [
    {
      name: 'supplyWay',
      placeholder: '计划类别',
      label: '计划类别',
      componentType: 'Select',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
      dataSource: supplyWayList,
    },
    {
      name: 'needName',
      placeholder: '计划标题',
      label: '计划标题',
      componentType: 'Input',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'expectSum',
      placeholder: '预估总价',
      label: '预估总价',
      componentType: 'NumberRange',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'state',
      placeholder: '计划状态',
      label: '计划状态',
      componentType: 'Select',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: false,
      dataSource: needStateList,
    },
    // ==========================高级搜索==============================
    {
      name: 'createTime',
      placeholder: '',
      label: '创建时间',
      componentType: 'RangePicker',
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: true,
    },
    {
      name: 'createFormName',
      placeholder: '创建',
      label: '创建',
      componentType: 'DeptAndUser',
      dataSource: getLevelZeroJson() ?? [],
      allowClear: true,
      md: 8,
      sm: 24,
      whetherSenior: true, //是否放到更多搜索里面
      formOrgType: {
        COMP: 'createCompanyID',
        DEPT: 'createDepartmentID',
        POS: 'createPositionID',
        USER: 'createrID',
      },
    },
  ];
};
